package com.mypro.common.user;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.mypro.common.base.BaseService;

@Service
public class FunctionService extends BaseService<Function> {

	public Function findById(Integer id){
		return dao.get(id);
	}

	public List<Function> findChildById(Integer parentId) {
		Map values = new HashMap();
		values.put("parentId", parentId);
		return dao.find("from Function where parentId=:parentId and valid=true order by funWeight", values);
	}
}
